<extend name="Base/common"/>
<block name="style">
    <link href="__CSS__/recharge.css" rel="stylesheet" type="text/css"/>
</block>
<block name="header">
    <include file="Public/_nav"/>
</block>


<block name="body">
    <div class="common-block">
        <section>
            <div class="row">
                <div class="col-xs-12">
                    <p>&nbsp;</p>
                    <h4>{:L('_ORDER_INFO_')}</h4>
                    <hr class="oneuser-title-hr"/>
                </div>
            </div>
            <include file="_menu"/>
            <div style="margin-bottom: 50px">
                <h3 style="font-size: 16px;font-weight: bold">{:L('_ORDER_INFO_')}</h3>
                <hr/>
                <blockquote>
                    <table class="table table-bordered">
                        <tr>
                            <td>{:L('_ORDER_ID_')}</td>
                            <td>{$order.id}</td>
                        </tr>
                        <tr>
                            <td>{:L('_RECHARGE_SCORE_TYPE_')}</td>
                            <td>{$order.score_type.title}</td>
                        </tr>
                        <tr>
                            <td>{:L('_RECHARGE_AMOUNT_')}</td>
                            <td>{$order.amount} 元</td>
                        </tr>
                        <tr>
                            <td>{:L('_RECHARGE_RATIO_')}</td>

                            <td>
                                1 RMB = {$order.recharge_type.UNIT} {$order.score_type.unit} {$order.score_type.title}
                            </td>
                        </tr>
                        <tr>
                            <td> {:L('_GAIN_',array('score'=>$order['score_type']['title']))} </td>
                            <td>

                                <php>echo floor($order['recharge_type']['UNIT']*$order['amount']);</php>
                                {$order.score_type.unit}【{:L('_ABANDON_DECIMAL_')}】
                            </td>
                        </tr>
                        <tr>
                            <td>{:L('_RECHARGE_METHOD_')}</td>
                            <td>{$order['pay_method']}</td>
                        </tr>
                        <tr>
                            <td>{:L('_ORDER_STATUS_')}</td>
                            <td>{:get_order_status_cn($order['id'])}</td>
                        </tr>

                    </table>
                </blockquote>

                <php>if(get_order_status($order['id']) == 0 ){</php>
                <div style="margin-bottom: 30px" class="clearfix">
                    <form action="{:U('pingxx/CallPingxx/pay')}" method="post" target="_blank">
                        <input type="hidden" name="order_id" value="{$order.id}"/>
                        <button class="btn btn-primary pull-right" type="submit">{:L('_PAY_NOW_')}</button>
                    </form>
                </div>
                <php>}</php>

                <php> if($charge){</php>
                <h3 style="font-size: 16px;font-weight: bold">Ping++{:L('_ORDER_INFO_')}</h3>
                <blockquote>
                    <table class="table table-bordered">
                        <tr>
                            <td>{:L('_ORDER_ID_')}</td>
                            <td>{$charge.order_no}</td>
                        </tr>

                        <tr>
                            <td>{:L('_ORDER_CREATE_TIME_')}</td>
                            <td> {$charge.created|date='Y-m-d H:i',###}</td>
                        </tr>

                        <tr>
                            <td>Ping++ {:L('_ORDER_ID_')}</td>
                            <td>{$charge.charge_id}</td>
                        </tr>


                        <tr>
                            <td>{:L('_RECHARGE_CHANNEL_')}</td>
                            <td>{$charge.channel}</td>
                        </tr>


                        <tr>
                            <td>{:L('_BUYER_ACCOUNT_')}</td>
                            <td>{$charge.buyer_account}</td>
                        </tr>

                        <tr>
                            <td>{:L('_AMOUNT_')}</td>
                            <td>
                                ￥ {$charge.amount} 元
                            </td>
                        </tr>

                        <tr>
                            <td>{:L('_GOODS_INFO_')}</td>
                            <td>
                                <span style="font-weight: 700;display: block">{$charge.data.subject}</span>
                                <span style="display: block">  {$charge.data.body}</span>

                            </td>
                        </tr>

                        <tr>
                            <td>{:L('_RECHARGE_IP_')}</td>
                            <td>
                                {$charge.data.client_ip}
                            </td>
                        </tr>

                        <tr>
                            <td>{:L('_ORDER_STATUS_')}</td>
                            <td>

                                <php>if($charge['paid']){
                                    $trade_status = L('_PAYMENT_SUCCESS_');
                                    }else{
                                    $trade_status = L('_PAYMENT_ERROR_');
                                    }

                                </php>
                                {$trade_status}
                            </td>
                        </tr>
                        <tr>
                            <td>{:L('_PAYMENT_TIME_')}</td>
                            <td>   {$charge.time_paid|date='Y-m-d H:i',###}</td>
                        </tr>
                    </table>


                </blockquote>
                <php>}</php>

            </div>

        </section>
    </div>

</block>